Skip to content

hisilicon-osdrv-hi3520dv200: ship V2 MPP headers + libhdmi.a#2120

Merged
widgetii merged 1 commit into
OpenIPC:masterfrom
widgetii:feat/hi3520dv200-v2-headers-libhdmi
May 21, 2026
Merged

hisilicon-osdrv-hi3520dv200: ship V2 MPP headers + libhdmi.a#2120
widgetii merged 1 commit into
OpenIPC:masterfrom
widgetii:feat/hi3520dv200-v2-headers-libhdmi

Conversation

@widgetii
Copy link
Copy Markdown
Member

Summary

Add board-specific MPP headers and the HDMI static library to the hi3520dv200 osdrv package so the published toolchain SDK ships them next to libmpi.so. Today the board has no files/include/ and the BUNDLE_SDK fallback (Makefile:131) copies the hi3516cv100 header set into every hisilicon toolchain — which works as a common-subset stopgap but has two real gaps for hi3520dv200:

  1. No HDMI headersmpi_hdmi.h / hi_comm_hdmi.h are V2-era additions (cv100 has no HDMI hardware), so consumers that need HI_MPI_HDMI_Open / SetAttr / Start to bring HDMI out of "do not Open" state have to vendor the headers themselves. Symptom: HI_MPI_VO_Enable returns 0x0, /proc/umap/vo claims DevEn=Y, but /proc/umap/hdmi reports HDMI driver do not Open and the monitor sees no signal.
  2. No libhdmi.a — the HDMI API is not exported by libmpi.so on this SoC (nm -D libmpi.so | grep HDMI returns nothing); vendor split it into a separate static library that has to be linked into the consumer.

ISP/sensor/3A headers from cv100 (mpi_isp.h, mpi_ae.h, etc.) are also misleading on this analog-input DVR SoC and just dead weight in the SDK.

What changes

general/package/hisilicon-osdrv-hi3520dv200/files/
├── include/      ← NEW (54 entries from openhisilicon kernel/include/hi3520dv200)
└── lib/
    └── libhdmi.a ← NEW (Hi3520D_SDK_V2.0.5.1/package/mpp/lib/libhdmi.a, 19 KiB)

Header diff cv100 → V2:

header reason
removed (cv100 only) acodec.h, hi_ae_comm.h, hi_af_comm.h, hi_awb_comm.h, hi_comm_3a.h, hi_comm_isp.h, hi_comm_sns.h, hi_isp_debug.h, hi_pq_bin.h, hi_sns_ctrl.h, hi_vreg.h, mod_ext.h, mpi_ae.h, mpi_af.h, mpi_awb.h, mpi_isp.h ISP / sensor / 3A — n/a on this SoC, no in-tree consumer references them
added (V2 only) hi_comm_hdmi.h, mpi_hdmi.h HDMI control API
hi_jpeg_api.h, jconfig.h, jerror.h, jmorecfg.h, jpeglib.h vendor JPEG decode/encode API
mkp/mod_ext.h vendor module extension
shared 46 other hi_comm_* / mpi_* / hi*.h / hifb.h V2 base, struct-compatible with the cv100 fallback we replace

Once BUNDLE_SDK sees the new files/include/, its ! -d \"$OSDRV_DIR/include\" guard skips the cv100 fallback and the published toolchain.hisilicon-hi3520dv200.tgz ships the V2-correct headers + libhdmi.a in sdk/include/ and sdk/lib/. Consumers then just -lhdmi like they already -lmpi.

Provenance

  • files/include/ content is a verbatim copy of openhisilicon's public mirror at kernel/include/hi3520dv200 (the same source that's been the de-facto reference for V2 MPP headers in the community).
  • files/lib/libhdmi.a is the vendor's static library from Hi3520D_SDK_V2.0.5.1/package/mpp/lib/libhdmi.a (the same SDK the existing libmpi.so / libaec.so / etc. in files/lib/ come from).

Why now / no regressions

No in-tree package currently compiles userspace against MPP headers for hi3520dv200 — hisilicon-osdrv-hi3520dv200 itself ships only kmods/scripts/blobs, and hisilicon-opensdk handles kernel modules. So this can't regress any existing build.

Verified end-to-end against the openhisilicon V2 header set in a downstream dvr_home demo (private hifb-demo repo): HI_MPI_VENC_CreateGroup / CreateChn / RegisterChn all return 0x0 on chns 0..3, and the HDMI bring-up sequence (InitOpenGetAttrSetAttr with HI_HDMI_VIDEO_FMT_720P_60Start) brings /proc/umap/hdmi to Open=y Start=y EDID Parse Status: Ok with the monitor displaying 720P60.

Test plan

  • make BOARD=hi3520dv200_lite builds clean (no in-tree consumers of MPP userspace headers to break).
  • BUNDLE_SDK packs the new files/include/ and files/lib/libhdmi.a into the toolchain tarball — confirmed by walking the Makefile logic; the cp -a $OSDRV_DIR/* copies both subdirs and the cv100-fallback guard skips correctly.
  • After merge: delete the stale toolchain.hisilicon-hi3520dv200.tgz release asset and re-run toolchain.yml (same pattern as the rebuild after glibc-compat: add static-link mmap shim (32-bit off_t for vendor V2 blobs) #2110); verify the new tarball ships sdk/include/mpi_hdmi.h and sdk/lib/libhdmi.a.
  • Downstream sanity: a consumer doing gcc ... -L\$(TOOLCHAIN)/sdk/lib -lmpi -lhdmi resolves all HI_MPI_HDMI_* symbols.

Refs

🤖 Generated with Claude Code

Today the published hi3520dv200 toolchain ships hi3516cv100-era MPP
headers as a fallback (Makefile BUNDLE_SDK at line 131: if a board has
no files/include/, the cv100 set is copied in unconditionally for every
hisilicon board). That worked as a stopgap because the common subset
of struct layouts is stable across V1/V2, but it has two gaps for
hi3520dv200:

  1. mpi_hdmi.h / hi_comm_hdmi.h are V2-era additions (cv100 has no
     HDMI hardware), so HDMI bring-up via HI_MPI_HDMI_Open/SetAttr/
     Start can't be compiled against the toolchain — consumers have to
     vendor the headers themselves.
  2. cv100 ships ISP/sensor/3A headers (mpi_isp.h, mpi_ae.h, etc.) that
     are meaningless on the analog-input hi3520dv200 board — they're
     dead weight and a source of misleading "cv100 SDK" assumptions.

Mirror the V2 hi3520dv200 header set from the openhisilicon kernel
include directory into files/include/.  Once the toolchain rebuilds,
the cv100 fallback is skipped (the `! -d "$OSDRV_DIR/include"` guard
in BUNDLE_SDK now sees the new dir) and the SDK ships the V2-correct
set:

  hi_comm_hdmi.h, mpi_hdmi.h        — HDMI control API (new)
  hi_jpeg_api.h + jpeg/libjpeg.h    — JPEG decode/encode API (new)
  mkp/mod_ext.h                     — vendor module extension (new)
  hi_comm_*, mpi_*, hi*.h, hifb.h   — V2 MPP base (replaces cv100)

Header diff cv100 -> V2:
  removed (cv100 only): acodec.h, hi_ae_comm.h, hi_af_comm.h,
    hi_awb_comm.h, hi_comm_3a.h, hi_comm_isp.h, hi_comm_sns.h,
    hi_isp_debug.h, hi_pq_bin.h, hi_sns_ctrl.h, hi_vreg.h, mod_ext.h,
    mpi_ae.h, mpi_af.h, mpi_awb.h, mpi_isp.h — all ISP/sensor/3A,
    none of which apply to hi3520dv200 (no in-tree consumer compiles
    against them for this board)
  added (V2 only): hi_comm_hdmi.h, mpi_hdmi.h, hi_jpeg_api.h,
    jconfig.h, jerror.h, jmorecfg.h, jpeglib.h, mkp/mod_ext.h
  shared: 46 headers (the common V1/V2 MPP base)

Also drops libhdmi.a alongside the existing libmpi.so / libaec.so /
etc. in files/lib/.  The HDMI control API (HI_MPI_HDMI_Init / Open /
GetAttr / SetAttr / Start) is NOT exported by libmpi.so on this SoC
(nm/strings come up empty) — vendor split it into a separate static
library that has to be linked into the consumer.  Without this, VO_Enable
returns 0x0 but the HDMI module reports "do not Open" in /proc/umap/hdmi
and the monitor sees no signal.

Source provenance:
  files/include/      <- openhisilicon kernel/include/hi3520dv200
                         (public mirror of vendor V2 MPP headers)
  files/lib/libhdmi.a <- Hi3520D_SDK_V2.0.5.1/package/mpp/lib/libhdmi.a
                         (vendor static library, 19 KiB)

No in-tree package currently builds userspace against MPP headers for
hi3520dv200 (osdrv ships only kmod/lib/script; opensdk handles kernel
modules), so this change can't regress any existing build.  Verified
the openhisilicon mirror's headers compile against the published
toolchain via the dvr_home demo (private hifb-demo repo) with VENC
all-channel bring-up and HDMI bring-up both succeeding.

Once this lands + the toolchain release rebuilds (delete the stale
toolchain.hisilicon-hi3520dv200.tgz asset, re-run toolchain.yml),
the next consumer to drive HDMI on this SoC can just `-lhdmi` like
they already `-lmpi` instead of vendoring the blob.
@widgetii widgetii merged commit 444c2bb into OpenIPC:master May 21, 2026
93 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant